package com.bjqh.edu.Bean;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by Administrator on 2017/9/25.
 */

public class Order implements Parcelable {

    /**
     * order : {"uid":50,"id":127,"deviceinfor":null,"coursedes":"适合小学二年级,一对一","time":1506479118000,"price":0.01,"status":null,"ordernum":"20170927102518380002","paytime":null,"cid":13,"coursename":"免费试听"}
     * status : 200
     * wechatPay : {"sign":"6843D142A5C45BBDA4E880AC027CCB54","result_code":"SUCCESS","mch_id":"1464702502","return_msg":"OK","prepay_id":"wx2017092710252079c25acb330206927383","appid":"wxfae41f13d5668fb1","return_code":"SUCCESS","nonce_str":"cPZyLYXbl1DbON9I","device_info":"mobile","trade_type":"APP"}
     * aiPay : alipay_sdk=alipay-sdk-java-dynamicVersionNo&app_id=2017092008827425&biz_content=%7B%22body%22%3A%22%E9%80%82%E5%90%88%E5%B0%8F%E5%AD%A6%E4%BA%8C%E5%B9%B4%E7%BA%A7%2C%E4%B8%80%E5%AF%B9%E4%B8%80%22%2C%22out_trade_no%22%3A%2220170927102518380002%22%2C%22product_code%22%3A%22QUICK_MSECURITY_PAY%22%2C%22subject%22%3A%22%E5%85%8D%E8%B4%B9%E8%AF%95%E5%90%AC%22%2C%22timeout_express%22%3A%2230m%22%2C%22total_amount%22%3A%220.01%22%7D&charset=UTF-8&format=json&method=alipay.trade.app.pay&notify_url=http%3A%2F%2F6c85e835.ngrok.io%2Fqhedu%2Forder%2FaiNotify.shtml&sign=S%2FqrmBNi19srA%2Ft0cRLw6rn2IgbzYIEfsP6gRnb%2B1w8l1z8YWR2W04IPZL6UILjtuDFuXpXiWCuYyDK9uwtEOhsXkU9BaSshLV4jgJZdBQZM0uMvrTYVCCupSFKylKrzbWY1FmJ3UOHDwzwa0KJJYM3Dw5AWlLUxzmpuXd5hBqiouzXho%2FaUj90nsML01U2mzXekbeL6p1VM8CX24k1dRkx60bJO5VOS%2BjJxact79lWziaPW%2Fwbvm9nzRDKknUg1WR5Nf%2FzNpAHHxeqfCJfGJaUpN6zBBMBTkCufRNDcmv27iqu40dfnUht6lsp3bfNyc%2BZq41LMfpwc%2FMa%2FjXBIAw%3D%3D&sign_type=RSA2&timestamp=2017-09-27+10%3A25%3A18&version=1.0
     */

    private OrderBean order;
    private int status;
    private WechatPayBean wechatPay;
    private String aiPay;
    private String msg;

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static Creator<Order> getCREATOR() {
        return CREATOR;
    }

    public OrderBean getOrder() {
        return order;
    }

    public void setOrder(OrderBean order) {
        this.order = order;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public WechatPayBean getWechatPay() {
        return wechatPay;
    }

    public void setWechatPay(WechatPayBean wechatPay) {
        this.wechatPay = wechatPay;
    }

    public String getAiPay() {
        return aiPay;
    }

    public void setAiPay(String aiPay) {
        this.aiPay = aiPay;
    }

    public static class OrderBean implements Parcelable {
        /**
         * uid : 50
         * id : 127
         * deviceinfor : null
         * coursedes : 适合小学二年级,一对一
         * time : 1506479118000
         * price : 0.01
         * status : null
         * ordernum : 20170927102518380002
         * paytime : null
         * cid : 13
         * coursename : 免费试听
         */

        private int uid;
        private int id;
        private String deviceinfor;
        private String coursedes;
        private Long time;
        private double price;
        private String status;
        private String ordernum;
        private String paytime;
        private int cid;
        private String coursename;

        public int getUid() {
            return uid;
        }

        public void setUid(int uid) {
            this.uid = uid;
        }

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getDeviceinfor() {
            return deviceinfor;
        }

        public void setDeviceinfor(String deviceinfor) {
            this.deviceinfor = deviceinfor;
        }

        public String getCoursedes() {
            return coursedes;
        }

        public void setCoursedes(String coursedes) {
            this.coursedes = coursedes;
        }

        public Long getTime() {
            return time;
        }

        public void setTime(Long time) {
            this.time = time;
        }

        public double getPrice() {
            return price;
        }

        public void setPrice(double price) {
            this.price = price;
        }

        public String getStatus() {
            return status;
        }

        public void setStatus(String status) {
            this.status = status;
        }

        public String getOrdernum() {
            return ordernum;
        }

        public void setOrdernum(String ordernum) {
            this.ordernum = ordernum;
        }

        public String getPaytime() {
            return paytime;
        }

        public void setPaytime(String paytime) {
            this.paytime = paytime;
        }

        public int getCid() {
            return cid;
        }

        public void setCid(int cid) {
            this.cid = cid;
        }

        public String getCoursename() {
            return coursename;
        }

        public void setCoursename(String coursename) {
            this.coursename = coursename;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeInt(this.uid);
            dest.writeInt(this.id);
            dest.writeString(this.deviceinfor);
            dest.writeString(this.coursedes);
            dest.writeValue(this.time);
            dest.writeDouble(this.price);
            dest.writeString(this.status);
            dest.writeString(this.ordernum);
            dest.writeString(this.paytime);
            dest.writeInt(this.cid);
            dest.writeString(this.coursename);
        }

        public OrderBean() {
        }

        protected OrderBean(Parcel in) {
            this.uid = in.readInt();
            this.id = in.readInt();
            this.deviceinfor = in.readString();
            this.coursedes = in.readString();
            this.time = (Long) in.readValue(Long.class.getClassLoader());
            this.price = in.readDouble();
            this.status = in.readString();
            this.ordernum = in.readString();
            this.paytime = in.readString();
            this.cid = in.readInt();
            this.coursename = in.readString();
        }

        public static final Creator<OrderBean> CREATOR = new Creator<OrderBean>() {
            @Override
            public OrderBean createFromParcel(Parcel source) {
                return new OrderBean(source);
            }

            @Override
            public OrderBean[] newArray(int size) {
                return new OrderBean[size];
            }
        };
    }

    public static class WechatPayBean implements Parcelable {
        /**
         * sign : 6843D142A5C45BBDA4E880AC027CCB54
         * result_code : SUCCESS
         * mch_id : 1464702502
         * return_msg : OK
         * prepay_id : wx2017092710252079c25acb330206927383
         * appid : wxfae41f13d5668fb1
         * return_code : SUCCESS
         * nonce_str : cPZyLYXbl1DbON9I
         * device_info : mobile
         * trade_type : APP
         */

        private String sign;
        private String result_code;
        private String mch_id;
        private String return_msg;
        private String prepay_id;
        private String appid;
        private String return_code;
        private String nonce_str;
        private String device_info;
        private String trade_type;

        public String getSign() {
            return sign;
        }

        public void setSign(String sign) {
            this.sign = sign;
        }

        public String getResult_code() {
            return result_code;
        }

        public void setResult_code(String result_code) {
            this.result_code = result_code;
        }

        public String getMch_id() {
            return mch_id;
        }

        public void setMch_id(String mch_id) {
            this.mch_id = mch_id;
        }

        public String getReturn_msg() {
            return return_msg;
        }

        public void setReturn_msg(String return_msg) {
            this.return_msg = return_msg;
        }

        public String getPrepay_id() {
            return prepay_id;
        }

        public void setPrepay_id(String prepay_id) {
            this.prepay_id = prepay_id;
        }

        public String getAppid() {
            return appid;
        }

        public void setAppid(String appid) {
            this.appid = appid;
        }

        public String getReturn_code() {
            return return_code;
        }

        public void setReturn_code(String return_code) {
            this.return_code = return_code;
        }

        public String getNonce_str() {
            return nonce_str;
        }

        public void setNonce_str(String nonce_str) {
            this.nonce_str = nonce_str;
        }

        public String getDevice_info() {
            return device_info;
        }

        public void setDevice_info(String device_info) {
            this.device_info = device_info;
        }

        public String getTrade_type() {
            return trade_type;
        }

        public void setTrade_type(String trade_type) {
            this.trade_type = trade_type;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.sign);
            dest.writeString(this.result_code);
            dest.writeString(this.mch_id);
            dest.writeString(this.return_msg);
            dest.writeString(this.prepay_id);
            dest.writeString(this.appid);
            dest.writeString(this.return_code);
            dest.writeString(this.nonce_str);
            dest.writeString(this.device_info);
            dest.writeString(this.trade_type);
        }

        public WechatPayBean() {
        }

        protected WechatPayBean(Parcel in) {
            this.sign = in.readString();
            this.result_code = in.readString();
            this.mch_id = in.readString();
            this.return_msg = in.readString();
            this.prepay_id = in.readString();
            this.appid = in.readString();
            this.return_code = in.readString();
            this.nonce_str = in.readString();
            this.device_info = in.readString();
            this.trade_type = in.readString();
        }

        public static final Creator<WechatPayBean> CREATOR = new Creator<WechatPayBean>() {
            @Override
            public WechatPayBean createFromParcel(Parcel source) {
                return new WechatPayBean(source);
            }

            @Override
            public WechatPayBean[] newArray(int size) {
                return new WechatPayBean[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable((Parcelable) this.order, flags);
        dest.writeInt(this.status);
        dest.writeParcelable((Parcelable) this.wechatPay, flags);
        dest.writeString(this.aiPay);
    }

    public Order() {
    }

    protected Order(Parcel in) {
        this.order = in.readParcelable(OrderBean.class.getClassLoader());
        this.status = in.readInt();
        this.wechatPay = in.readParcelable(WechatPayBean.class.getClassLoader());
        this.aiPay = in.readString();
    }

    public static final Parcelable.Creator<Order> CREATOR = new Parcelable.Creator<Order>() {
        @Override
        public Order createFromParcel(Parcel source) {
            return new Order(source);
        }

        @Override
        public Order[] newArray(int size) {
            return new Order[size];
        }
    };
}
